//dialog.js
import Vue from 'vue'
//组件路径
import dialog from '../components/emailPopup/emailPopup.vue'
  
  const constructor = Vue.extend(dialog)
  const instance = new constructor()
  
export const showDialog =(getUserDetail) => {
    instance.$mount()
    console.log('instance',instance)
    if (document.body.querySelector("#toast")) {
      instance.open()
      return
    }
    document.body.appendChild(instance.$el)
    
    instance.open()
    instance.getUserDetail=getUserDetail || null
}

// 封装一个点击弹框消失的
export const closeDialog =() => {
  instance.close()
}

